import { IContext } from '@/core';
/**
 * 实体服务注册中心
 * 基于template/src/register/entity-service-register.ts.hbs生成
 *
 * @export
 * @class EntityServiceRegister
 */
export class EntityServiceRegister {

	/**
	 * 实体服务注册中心对象
	 *
	 * @private
	 * @static
	 * @type {EntityServiceRegister}
	 * @memberof EntityServiceRegister
	 */
	private static register: EntityServiceRegister;

	/**
	 * Creates an instance of EntityServiceRegister.
	 * 禁止使用new获取实体服务注册中心对象
	 * @memberof EntityServiceRegister
	 */
	private constructor() {}

	/**
	 * 获取实体服务注册中心对象
	 *
	 * @static
	 * @return {*}  {EntityServiceRegister}
	 * @memberof EntityServiceRegister
	 */
	static getInstance(): EntityServiceRegister {
		if (!this.register) {
			this.register = new EntityServiceRegister();
		}
		return this.register;
	}

	/**
	 * 获取实体服务
	 *
	 * @param {string} name 实体名称
	 * @param {IContext} [context={}] 应用上下文
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	public async getService(name: string, context: IContext = {}): Promise<any> {
		const targetService: any = await (this as any)[`get${name}Service`](context);
		return targetService;
	}

	/**
	 * 授权系统服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getAuth_granted_systemService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/auth-granted-system/data-service/auth-granted-system-service')).default.getInstance(context);
	}

	/**
	 * 组件使用接口服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_component_apiService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/sys-component-api/data-service/sys-component-api-service')).default.getInstance(context);
	}

	/**
	 * 授权对象服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getAuth_grantedService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/auth-granted/data-service/auth-granted-service')).default.getInstance(context);
	}

	/**
	 * 系统服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_deploy_systemService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/sys-deploy-system/data-service/sys-deploy-system-service')).default.getInstance(context);
	}

	/**
	 * 组织单元服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_organizational_unitService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/sys-organizational-unit/data-service/sys-organizational-unit-service')).default.getInstance(context);
	}

	/**
	 * 授权角色服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getAuth_granted_roleService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/auth-granted-role/data-service/auth-granted-role-service')).default.getInstance(context);
	}

	/**
	 * CN服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_common_nameService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/sys-common-name/data-service/sys-common-name-service')).default.getInstance(context);
	}

	/**
	 * 部门服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_departmentService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/sys-department/data-service/sys-department-service')).default.getInstance(context);
	}

	/**
	 * 登录信息服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getAuthService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/auth/data-service/auth-service')).default.getInstance(context);
	}

	/**
	 * 认证信息服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getAuth_infoService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/auth-info/data-service/auth-info-service')).default.getInstance(context);
	}

	/**
	 * 数据范围服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_data_scopeService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/sys-data-scope/data-service/sys-data-scope-service')).default.getInstance(context);
	}

	/**
	 * 认证用户服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getAuth_userService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/auth-user/data-service/auth-user-service')).default.getInstance(context);
	}

	/**
	 * 菜单功能服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_menu_funcService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/sys-menu-func/data-service/sys-menu-func-service')).default.getInstance(context);
	}

	/**
	 * 接入认证绑定服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getOPEN_ACCESS_AUTHService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/open-access-auth/data-service/open-access-auth-service')).default.getInstance(context);
	}

	/**
	 * AD服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_active_directoryService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/sys-active-directory/data-service/sys-active-directory-service')).default.getInstance(context);
	}

	/**
	 * 系统菜单服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_menuService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/sys-menu/data-service/sys-menu-service')).default.getInstance(context);
	}

	/**
	 * 接口服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_apiService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/sys-api/data-service/sys-api-service')).default.getInstance(context);
	}

	/**
	 * 域服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_domainService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/sys-domain/data-service/sys-domain-service')).default.getInstance(context);
	}

	/**
	 * 人员服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_personService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/sys-person/data-service/sys-person-service')).default.getInstance(context);
	}

	/**
	 * oauth客户端信息服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getOAUTH_CLIENT_DETAILSService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/oauth-client-details/data-service/oauth-client-details-service')).default.getInstance(context);
	}

	/**
	 * 系统角色服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_roleService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/sys-role/data-service/sys-role-service')).default.getInstance(context);
	}

	/**
	 * 用户组服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_organizational_roleService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/sys-organizational-role/data-service/sys-organizational-role-service')).default.getInstance(context);
	}

	/**
	 * 成员服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_memberService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/sys-member/data-service/sys-member-service')).default.getInstance(context);
	}

	/**
	 * 统一认证/外部认证服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getAUTH_PROVIDERService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/auth-provider/data-service/auth-provider-service')).default.getInstance(context);
	}

	/**
	 * 自定义资源服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_custom_resourceService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/sys-custom-resource/data-service/sys-custom-resource-service')).default.getInstance(context);
	}

	/**
	 * 角色授权资源服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_granted_authorityService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/sys-granted-authority/data-service/sys-granted-authority-service')).default.getInstance(context);
	}

	/**
	 * 组件服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_componentService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/sys-component/data-service/sys-component-service')).default.getInstance(context);
	}

	/**
	 * 登录日志服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getAUTH_LOGService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/auth-log/data-service/auth-log-service')).default.getInstance(context);
	}

	/**
	 * 权限资源服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_permissionService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/sys-permission/data-service/sys-permission-service')).default.getInstance(context);
	}

	/**
	 * 开放接入服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getOPEN_ACCESSService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/open-access/data-service/open-access-service')).default.getInstance(context);
	}

	/**
	 * 组织机构服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_organizationService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/sys-organization/data-service/sys-organization-service')).default.getInstance(context);
	}

	/**
	 * GroupOfNames服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_group_of_namesService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/sys-group-of-names/data-service/sys-group-of-names-service')).default.getInstance(context);
	}

	/**
	 * 隶属信息服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getAuth_memberService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/auth-member/data-service/auth-member-service')).default.getInstance(context);
	}

	/**
	 * 接口方法服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_api_operationService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/sys-api-operation/data-service/sys-api-operation-service')).default.getInstance(context);
	}

	/**
	 * 系统角色成员服务
	 *
	 * @param {IContext} [context={}]
	 * @return {*}  {Promise<any>}
	 * @memberof EntityServiceRegister
	 */
	async getSys_role_memberService(context: IContext = {}): Promise<any> {
		return (await import ('@/api/sys-role-member/data-service/sys-role-member-service')).default.getInstance(context);
	}

}